#pragma once
/*
FC_SEND_CLIENT_DATA			000000
FC_OVER_VOLTAGE_WARNING		000010
FC_NOT_BALANCE_WARNING		000100
FC_REVERSE_SEQUENCE_WARNING	000110
FC_POWER_DOWN_WARNING		001000
FC_OVER_POWER_WARNING		001100
FC_HEARTBEAT_ACK			001110
FC_STOCHASTIC_REQUEST_DATA	000001
FC_OVERLOAD					000101
FC_HEARTBEAT_CHECK			000111
FC_ERROR_ACK				001111
*/
//Client Function Code
#define FC_SEND_CLIENT_DATA			0
#define FC_OVER_VOLTAGE_WARNING		2
#define FC_NOT_BALANCE_WARNING		4
#define FC_REVERSE_SEQUENCE_WARNING	6
#define FC_POWER_DOWN_WARNING		8
#define FC_OVER_POWER_WARNING		12
#define FC_HEARTBEAT_ACK			14
//Center Function Code
#define FC_STOCHASTIC_REQUEST_DATA	1
#define FC_OVERLOAD					5
#define FC_HEARTBEAT_CHECK			7
#define FC_ERROR_ACK				15
//Client thread Id
#define CLIENT_THID_LISTENER_MAIN				0
#define CLIENT_THID_SPEAKER_NORMAL_SENDDATA		1
#define CLIENT_THID_SPEAKER_REGULAR_SENDDATA	2
#define CLIENT_THID_SPEAKER_WARNING				3
#define CLIENT_THID_SPEAKER_HEARTBEAT_ACK		4
//Center thread Id
#define CENTER_THID_LISTENER_MAIN					0
#define CENTER_THID_SPEAKER_NORMAL_REQUESTDATA		1
#define CENTER_THID_SPEAKER_REQUESTDATA_WITH_RETRY	2
#define CENTER_THID_SPEAKER_ERROR_ACK				3
#define CENTER_THID_SPEAKER_OVERLOAD				4
#define CENTER_THID_SPEAKER_HEARTBEAT				5
//Sleeping million seconds
//#define SLEEP_REGULAR_SENDDATA			10000
//#define SLEEP_CONNECT_CLIENT_RETRY		3000
//#define SLEEP_WARNING_RETRY				3000
//#define SLEEP_OVERLOAD_RETRY			10000
//#define SLEEP_HEARTBEAT					10000
//#define SLEEP_HEARTBEAT_RETRY			1000
//Address
#define ADDRESS_CENTER				0x00
#define ADDRESS_CLIENT_THIS			0x01
//Retry times
#define CENTER_REQUEST_DATA_TIMES_MAX	3
#define CENTER_HEARTBEAT_ACK_TIMES_MAX	3
#define CLIENT_WARNING_RETRY_TIMES_MAX	3
//Config File
#define SERVER_CONFIG_FILE	".\\server-config.ini"
#define CLIENT_CONFIG_FILE	".\\client-config.ini"